<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<script>
    var xhr = new XMLHttpRequest;
    xhr.open('POST','http://localhost:8080/reg',true);
    xhr.responseType = 'json';
    xhr.onreadystatechange = function(){
        if(xhr.readyState==4 && xhr.status==200){
            console.log(xhr.response);
        }
    }
    xhr.send(JSON.stringify({name:'xiaoli'}));
</script>
</body>
</html>